From ae6015a69b211a98f9ef97d73b5c301c359ca35f Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 21 Dec 2022 19:27:11 -0500 Subject: qt: use main window as close overlay parent --- src/yuzu/main.cpp | 5 ++--- src/yuzu/util/overlay_dialog.cpp | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 66fdbcfed..c67fb997a 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1815,9 +1815,8 @@ void GMainWindow::OnShutdownBegin() { } void GMainWindow::OnShutdownBeginDialog() { - shutdown_dialog = - new OverlayDialog(render_window, *system, QString{}, tr("Closing software..."), QString{}, - QString{}, Qt::AlignHCenter | Qt::AlignVCenter); + shutdown_dialog = new OverlayDialog(this, *system, QString{}, tr("Closing software..."), + QString{}, QString{}, Qt::AlignHCenter | Qt::AlignVCenter); shutdown_dialog->open(); } diff --git a/src/yuzu/util/overlay_dialog.cpp b/src/yuzu/util/overlay_dialog.cpp index 25fa789ac..796f5bf41 100644 --- a/src/yuzu/util/overlay_dialog.cpp +++ b/src/yuzu/util/overlay_dialog.cpp @@ -3,6 +3,7 @@ #include #include +#include #include "core/core.h" #include "core/hid/hid_types.h" @@ -162,7 +163,7 @@ void OverlayDialog::MoveAndResizeWindow() { const auto height = static_cast(parentWidget()->height()); // High DPI - const float dpi_scale = qApp->screenAt(pos)->logicalDotsPerInch() / 96.0f; + const float dpi_scale = parentWidget()->windowHandle()->screen()->logicalDotsPerInch() / 96.0f; const auto title_text_font_size = BASE_TITLE_FONT_SIZE * (height / BASE_HEIGHT) / dpi_scale; const auto body_text_font_size = -- cgit v1.2.3